package consts

var (

	/** 数据库字符串类型 */
	COLUMNTYPE_STR = []string{"char", "varchar", "nvarchar", "varchar2"}

	/** 数据库文本类型 */
	COLUMNTYPE_TEXT = []string{"tinytext", "text", "mediumtext", "longtext"}

	/** 数据库时间类型 */
	COLUMNTYPE_TIME = []string{"datetime", "time", "date", "timestamp"}

	/** 数据库数字类型 */
	COLUMNTYPE_NUMBER = []string{"tinyint", "smallint", "mediumint", "int", "number", "integer",
		"bit", "bigint", "float", "double", "decimal"}

	/** 页面不需要编辑字段 */
	COLUMNNAME_NOT_EDIT = []string{"id", "create_by", "create_time", "del_flag"}

	/** 页面不需要显示的列表字段 */
	COLUMNNAME_NOT_LIST = []string{"id", "create_by", "create_time", "del_flag", "update_by",
		"update_time"}

	/** 页面不需要查询字段 */
	COLUMNNAME_NOT_QUERY = []string{"id", "create_by", "create_time", "del_flag", "update_by",
		"update_time", "remark"}

	/** Entity基类字段 */
	BASE_ENTITY = []string{"createBy", "createTime", "updateBy", "updateTime", "remark"}

	/** Tree基类字段 */
	TREE_ENTITY = []string{"parentName", "parentId", "orderNum", "ancestors", "children"}
)

const (
	/** 单表（增删改查） */
	TPL_CRUD = "crud"

	/** 树表（增删改查） */
	TPL_TREE = "tree"

	/** 主子表（增删改查） */
	TPL_SUB = "sub"
	/** 树编码字段 */
	TREE_CODE = "treeCode"

	/** 树父编码字段 */
	TREE_PARENT_CODE = "treeParentCode"

	/** 树名称字段 */
	TREE_NAME = "treeName"

	/** 上级菜单ID字段 */
	PARENT_MENU_ID = "parentMenuId"

	/** 上级菜单名称字段 */
	PARENT_MENU_NAME = "parentMenuName"

	/** 文本框 */
	HTML_INPUT = "input"

	/** 文本域 */
	HTML_TEXTAREA = "textarea"

	/** 下拉框 */
	HTML_SELECT = "select"

	/** 单选框 */
	HTML_RADIO = "radio"

	/** 复选框 */
	HTML_CHECKBOX = "checkbox"

	/** 日期控件 */
	HTML_DATETIME = "datetime"

	/** 图片上传控件 */
	HTML_IMAGE_UPLOAD = "imageUpload"

	/** 文件上传控件 */
	HTML_FILE_UPLOAD = "fileUpload"

	/** 富文本控件 */
	HTML_EDITOR = "editor"

	/** 字符串类型 */
	TYPE_STRING = "String"

	/** 整型 */
	TYPE_INTEGER = "Integer"

	/** 长整型 */
	TYPE_LONG = "Long"

	/** 浮点型 */
	TYPE_DOUBLE = "Double"

	/** 高精度计算类型 */
	TYPE_BIGDECIMAL = "BigDecimal"

	/** 时间类型 */
	TYPE_DATE = "Date"

	/** 模糊查询 */
	QUERY_LIKE = "LIKE"

	/** 相等查询 */
	QUERY_EQ = "EQ"

	/** 需要 */
	REQUIRE = "1"

	TplType_Model      = 1
	TplType_Service    = 2
	TplType_Controller = 3
	TplType_Req        = 4
	TplType_Resp       = 5
	TplType_Sql        = 6

	TplType_Router_Makeup = 7

	TplType_Ctrl_Import_Vars = 8
	TplType_Ctrl_Export_Vars = 9

	TplType_Serv_Import_Vars = 10
	TplType_Serv_Export_Vars = 11
	TplType_Struct_Index     = 12
	TplType_Api_Struct       = 13
)

var (
	//类型-> 路径映射
	TplType_Path_Map = map[int]string{
		TplType_Model:            "models",
		TplType_Service:          "services",
		TplType_Controller:       "web/v1/http",
		TplType_Req:              "web/pogos/request",
		TplType_Resp:             "web/pogos/response",
		TplType_Sql:              "sql",
		TplType_Router_Makeup:    "web/routers/internal",
		TplType_Ctrl_Import_Vars: "web/v1/http",
		TplType_Ctrl_Export_Vars: "web/v1/http",
		TplType_Serv_Import_Vars: "services",
		TplType_Serv_Export_Vars: "services",
		TplType_Struct_Index:     "front/src/views",
		TplType_Api_Struct:       "front/src/api",
	}

	TplFilesByTable = []string{
		"model.go.tpl",
		"service.go.tpl",
		"controller.go.tpl",
		"req.go.tpl",
		"resp.go.tpl",
		"sql.tpl",
		//front
		"struct_index.vue.tpl",
		"api_struct.js.tpl",
	}

	TplFileByModuleAggregate = []string{
		"ctrl_export_vars.go.tpl",
		"ctrl_import_vars.go.tpl",
		"serv_export_vars.go.tpl",
		"serv_import_vars.go.tpl",
	}

	TplFilesByAggregate = []string{
		"router_makeup.go.tpl",
	}

	TplFileName_Type_Map = map[string]int{
		"model.go.tpl":            TplType_Model,
		"service.go.tpl":          TplType_Service,
		"controller.go.tpl":       TplType_Controller,
		"req.go.tpl":              TplType_Req,
		"resp.go.tpl":             TplType_Resp,
		"sql.tpl":                 TplType_Sql,
		"router_makeup.go.tpl":    TplType_Router_Makeup,
		"ctrl_import_vars.go.tpl": TplType_Ctrl_Import_Vars,
		"ctrl_export_vars.go.tpl": TplType_Ctrl_Export_Vars,
		"serv_import_vars.go.tpl": TplType_Serv_Import_Vars,
		"serv_export_vars.go.tpl": TplType_Serv_Export_Vars,
		"struct_index.vue.tpl":    TplType_Struct_Index,
		"api_struct.js.tpl":       TplType_Api_Struct,
	}
)
